home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MENU_UTL / ENHMENU / ENHMENUS.DOC < prev    next >
Text File  |  1991-03-29  |  33KB  |  698 lines

  1.                                 EnhMenus ver 1.0
  2.                      An Enhanced Menu System for TurboVision
  3.                  Copyright 1991 Software Applications of Wichita
  4.  
  5.      OVERVIEW
  6.      --------
  7.      EnhMenus is a menu system designed to replace the MENUS.TPU included
  8.      with TurboVision.  EnhMenus provides the same functionality as the
  9.      standard Menus unit and is fully compatible with it.  However,
  10.      EnhMenus extends past Menus in many important respects by being
  11.      completely object-oriented.  All data structures (MenuItem, MenuBar,
  12.      MenuBox, etc) have been changed to objects instead of records.
  13.      Because of this, EnhMenus can be changed in any way you like without
  14.      extensive recoding, unlike the standard Menus unit.  Furthermore,
  15.      EnhMenus provides exactly the same procedures and functions that Menus
  16.      does, thus you're existing code should not require any modification.
  17.  
  18.      In addition to extending it, EnhMenus also corrects some bugs in the
  19.      Menus unit.  For example, select the the File menu in the IDE, press
  20.      F1 for help, and then close the Help window using the close icon and
  21.      the mouse.  The menu disappears!
  22.  
  23.      SHAREWARE
  24.      ---------
  25.      Please note that EnhMenus is not free software.  It is distributed
  26.      under the ShareWare concept of marketing.  This allows to see and use
  27.      the software before buying.  If you decide to use EnhMenus for your
  28.      own purposes, you must register it.  Registration involves sending in
  29.      the accompanying order form (in the file Order.Frm) along with the
  30.      payment of $15.00.  Upon registration you will receive the non-
  31.      shareware version of EnhMenus and its source code.  Registration
  32.      entitles you to link EnhMenus to any end product you like so long as
  33.      the source code, nor the TPU file is redistributed.
  34.  
  35.      FILES INCLUDED
  36.      --------------
  37.      This ZIP includes the following files:
  38.           EnhMenus.Tpu   - This unit contains the menu routines and objects
  39.           EnhMenus.Doc   - This file.
  40.           Demo.Exe       - Demo program for EnhMenus.
  41.           Demo.Pas       - Source code for Demo.Exe
  42.           Demo.Doc       - Please read this file while looking at the Demo,
  43.                            it highlights features of EnhMenus to look for.
  44.           Order.Frm      - An order form to receive the non-shareware
  45.                            version of EnhMenus and its source code.
  46.           Read.Me        - Introductory text file.
  47.  
  48.      INSTALLATION AND USE
  49.      --------------------
  50.      To use EnhMenus, the Uses clause in the App unit must be changed to
  51.      use EnhMenus instead of Menus.  So, instead of
  52.         uses Objects, Drivers, Memory, HistList, Views, Menus;
  53.      It will read:
  54.         uses Objects, Drivers, Memory, HistList, Views, EnhMenus;
  55.  
  56.  
  57.      ______________________________________________________________________
  58.      Turbo Pascal, TurboVision are trademarks or registered trademarks of
  59.      Borland International, Inc.  Portions of this documentation are taken
  60.      from TurboVision Guide and are copyrighted by Borland International.      The App unit must then be recompiled and any units that use the App
  61.      must similarly be recompiled.
  62.      Don't forget to keep a backup of the original App.Pas and App.Tpu
  63.      files!
  64.  
  65.      SIMILARITIES AND DIFFERENCES
  66.      ----------------------------
  67.      As far as strict TurboVision programming is concerned, there is no
  68.      difference between the EnhMenus and Menus units.  Status line and menu
  69.      functions,
  70.           NewItem        \
  71.           NewLine         \______ Menu routines
  72.           NewSubMenu      /
  73.           NewMenu        /
  74.           DisposeMenu   /
  75.           NewStatusDef \_________ Status line routines
  76.           NewStatusKey /
  77.      all work exactly the same in EnhMenus as they do in Menus.  This
  78.      ensures that your source units will not require any change if you
  79.      access the status line and menus with these routines.  However, if you
  80.      deal directly with the various menu and status line data structures,
  81.      some modification of the code will be required.
  82.  
  83.      NOTE:  Although EnhMenus uses the same registration codes for the
  84.      menus and status line objects as Menus, they are NOT compatible!  An
  85.      attempt to read Menus objects from a stream by EnhMenus will result in
  86.      an error.
  87.  
  88.      EnhMenus also defines three new constants, sfPulled, sfUpdate, and
  89.      ofPull.  These are used as flags in the State and Options fields of
  90.      the View object.  They are defined so they don't interfere with use of
  91.      other flags included in TurboVision.  The flags are described in
  92.      detail below.
  93.  
  94.      The only other major difference between EnhMenus and Menus is the
  95.      fully object nature of EnhMenus which is described below.
  96.  
  97.      ENHMENUS OBJECTS
  98.      ----------------
  99.      TMenuItem - Descended from TObject
  100.           This object is only instantiated for a divider line.  More often,
  101.           the objects TMenuCommand and TMenuSubMenu will be used.
  102.  
  103.           FIELDS
  104.           ------
  105.           Next : PMenuItem                                        READ ONLY
  106.                Points to the next item in the menu.  It is nil if here is
  107.                no next item.
  108.           Name : PString                                          READ ONLY
  109.                Points to the name of the menu item.  It is nil if the item
  110.                is a divider line.
  111.           Param : PString                                         READ ONLY
  112.                Points to the paramater list of the item.  Displayed only in
  113.                a MenuBox and as right-justified.
  114.  
  115.  
  116.  
  117.                                      - 2 -
  118.           View : PView                                            READ ONLY
  119.                Points to the view that the item generates.  For example a
  120.                sub-menu's View field will point to the sub-menu view.
  121.           KeyCode : Word                                         READ/WRITE
  122.                Stores the scan code for item's associated hotkey.  KeyCode
  123.                is zero if no hotkey exists.
  124.           HelpCtx : Word                                         READ/WRITE
  125.                Contains the menu item's help context number.
  126.  
  127.           METHODS
  128.           -------
  129.           Constructor Init(aName, aParam:TMenuStr; aHelpCtx:Word;
  130.                            aNext:PMenuItem);
  131.                Calls TObject.Init and then initializes the Name, Param,
  132.                HelpCtx, and Next fields.
  133.           Constructor Load(var S:TStream);
  134.                Creates a TMenuItem object and loads it from the stream.
  135.           Destructor Done; virtual;                     Override: Sometimes
  136.                Disposes of Name and Param and sets them to nil.
  137.           Function Command:Word; virtual;               Override: Sometimes
  138.                The default Command method returns cmValid.  If Command
  139.                returns anything other than cmValid, when the item is
  140.                activated, that command will be placed into the event queue
  141.                and the menu aborted.  If cmValid is returned, no command is
  142.                placed into the event queue and the menu is not aborted.  In
  143.                this way, it is possible for the menu structure to perform
  144.                other functions by overriding the Execute method.
  145.           Function Execute(ParentMenu:PMenuMetaView:Word); virtual;
  146.                                                         Override: Sometimes
  147.                Returns the command constant associated with the menu item
  148.                by calling Command.  By overriding this method, it is
  149.                possible for an item to perform many different purposes such
  150.                as issuing a Message.
  151.           Procedure HotKey(aKeyCode:Word):PMenuItem; virtual;
  152.                                                             Override: Often
  153.                The default HotKey method returns nil.
  154.           Procedure Pull(ParentMenu:PMenuMetaView; On:Boolean); virtual;
  155.                                                         Override: Sometimes
  156.                The default Pull method does nothing.  This method is called
  157.                whenever the use pulls down a menu from the menubar.
  158.           Procedure Store(var S:TStream); virtual;      Override: Sometimes
  159.                Saves the menu item on the stream.
  160.  
  161.      TMenuCommand - Descended from TMenuItem
  162.           Used for menu items that return a command to the application.
  163.           Most often TMenuCommand objects are created using the NewItem
  164.           function.
  165.  
  166.           METHODS
  167.           -------
  168.           Constructor Init(aName, aParam:TMenuStr; aKeyCode, aCommand,
  169.                            aHelpCtx:Word; aNext:PMenuItem);
  170.  
  171.  
  172.  
  173.  
  174.  
  175.                                      - 3 -
  176.                Calls TMenuItem.Init to initialize Name, Param, HelpCtx, and
  177.                Next.  Then KeyCode and Command are initialized to their
  178.                respective values.
  179.           Constructor Load(var S:TStream);
  180.                Creates a TMenuCommand object by reading its information
  181.                from the stream.
  182.           Function Command:Word; virtual;                  Override: Seldom
  183.                Returns the command associated with this item.
  184.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  185.                Stores information about the menu command on the stream.
  186.  
  187.      TMenuSubMenu - Descnded from TMenuItem
  188.           TMenuSubMenu is used for menu items that create a submenu when
  189.           selected, or pulled from the parent menu.  Normally, TMenuSubMenu
  190.           objects are created using the NewSubMenu function.
  191.  
  192.           FIELDS
  193.           ------
  194.           SubMenu : PMenu                                         READ ONLY
  195.                Points to the list structure of menu items contained in the
  196.                submenu.
  197.  
  198.           METHODS
  199.           -------
  200.           Constructor Init(aName, aParam:TMenuStr; aHelpCtx:Word;
  201.                            aSubMenu:PMenu; aNext:PMenuItem);
  202.                Calls TMenuItem to initialize Name, Param, HelpCtx, and
  203.                Next.  Then SubMenu is set to aSubMenu.
  204.           Constructor Load(var S:TStream);
  205.                Creates a TMenuSubMenu object from the information on the
  206.                stream.
  207.           Destructor Done; virtual;                        Override: Seldom
  208.                Disposes of SubMenu and then calls TMenuItem.Done.
  209.           Function Execute(ParentMenu:PMenuMetaView):Word; virtual;
  210.                                                            Override: Seldom
  211.                If not already pulled, the submenu is pulled by calling
  212.                Pull(ParentMenu, True).  ParentMenu^.Owner^.ExecView is
  213.                called with the submenu's associated view.  Finally, if the
  214.                menu had to be pulled it is put back, Pull(ParentMenu,
  215.                False).
  216.           Procedure HotKey(aKeyCode:Word):PMenuItem; virtual;
  217.                                                            Override: Seldom
  218.                Calls SubMenu^.HotKey to search the associated menu for
  219.                aKeyCode.
  220.           Procedure Pull(ParentMenu:PMenuMetaView; On:Boolean);
  221.                                                            Override: Seldom
  222.                Pull is used to create the submenu's view which is stored in
  223.                the inherited field, View.  If On is true, coordinates are
  224.                calculated and View is inserted into ParentMenu^.Owner.  If
  225.                On is false, View is deleted from ParentMenu^.Owner, View is
  226.                then disposed of and set to nil.
  227.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  228.                Stores the submenu item onto the stream.
  229.  
  230.  
  231.  
  232.  
  233.                                      - 4 -
  234.      TMenu - Descended from TObject
  235.           This contains the items in the menu along with the default menu
  236.           item.  It is most often created by NewMenu.
  237.  
  238.           FIELDS
  239.           ------
  240.           Items : PMenuItem                                       READ ONLY
  241.                A linked list of all the items in the menu.
  242.           Default : PMenuItem                                     READ ONLY
  243.                Points to the default item in the menu.
  244.  
  245.           METHODS
  246.           -------
  247.           Constructor Init(aItems:PMenuItem);
  248.                Assigns both Items and Default to aItems.
  249.           Constructor Load(var S:TStream);
  250.                Creates a TMenu object and then loads its menu items from
  251.                the stream.
  252.           Destructor Done; virtual;                        Override: Seldom
  253.                Disposes of every item in the menu.
  254.           Function HotKey(aKeyCode:Word):PMenuItem; virtual;
  255.                                                            Override: Seldom
  256.                Cycles through the items in the menu until it finds an item
  257.                with the aKeyCode as its hotkey.
  258.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  259.                Stores each of the items in the menu on the stream.
  260.  
  261.      TStatusDef - Descended from TMenu
  262.           TStatusDef is a stores the menu of items available on a status
  263.           line given a range of help contexts.  It is normally instantiated
  264.           using the NewStatusDef function.
  265.  
  266.           FIELDS
  267.           ------
  268.           Min : Word                                              READ ONLY
  269.                The minimum help context to which this particular status
  270.                definition applies.
  271.           Max : Word                                              READ ONLY
  272.                The maximum help context to which this particular status
  273.                definition applies.
  274.           Next : PStatusDef                                       READ ONLY
  275.                Points to the next status definition, nil if this definition
  276.                is the last.
  277.  
  278.           METHODS
  279.           -------
  280.           Constructor Init(aMin, aMax:Word; aItems:PMenuItem;
  281.                            aNext:PStatusDef);
  282.                Calls TMenu.Init to initialize Items.  Min, Max, and Next
  283.                are then set to their respective values.
  284.           Constructor Load(var S:TStream);
  285.                Creates a TStatusDef object and initializes it from the
  286.                information stored on the stream.
  287.           Procedure Store(var S:TStream);
  288.  
  289.  
  290.  
  291.                                      - 5 -
  292.                Stores the status definition onto the stream.
  293.  
  294.      TMenuMetaView - Descended from TView
  295.           TMenuMetaView is the backbone of the EnhMenus units; all menu
  296.           views are descended from this object.  Normally this object is
  297.           not instantiated.
  298.  
  299.           FIELDS
  300.           ------
  301.           Current : PMenuItem                                     READ ONLY
  302.                While the menu is in a modal state, Current points to the
  303.                highlighted item.  Otherwise, Current is nil.
  304.           ParentMenu : PMenuMetaView                              READ ONLY
  305.                ParentMenu points to the TMenuMetaView that owns this menu.
  306.  
  307.           METHODS
  308.           -------
  309.           Constructor Init(var Bounds:TRect);
  310.                Calls TView.Init to set Bounds and sets EventMask to include
  311.                evBroadcast.
  312.           Constructor Load(var S:TStream);
  313.                Creates a TMenuMetaView object and initializes its fields
  314.                from the stream.
  315.           Procedure Activate(Item:PMenuItem); virtual;     Override: Seldom
  316.                The Item^.Execute called with a pointer to Self given as the
  317.                ParentMenu.  If cmCancel is returned and the ParentMenu is
  318.                nil, then the menu structure is aborted with cmCancel.  If
  319.                cmValid is returned, no operation is performed.  If any
  320.                command other than cmCancel or cmValid is returned, EndModal
  321.                is called with the result.
  322.           Procedure ChangeCurrent(Item:PMenuItem); virtual;
  323.                                                            Override: Seldom
  324.                Changes Current to Item and displays a submenu if the
  325.                sfPulled flag is set.
  326.           Procedure EndModal(Command:Word); virtual;        Override: Never
  327.                EndModal ends the current modal state and returns Command as
  328.                result of the caller's ExecView.
  329.           Function Execute:Word; virtual;                   Override: Never
  330.                Executes a menu until the user selects a menu item or
  331.                cancels the menu.  Returns the command assigned to the menu
  332.                item or cmCancel if the menu was cancelled.
  333.           Function FindItem(Ch:Char):PMenuItem;
  334.                Returns a pointer to the menu item that has Ch as its
  335.                shortcut key the highlighted character).  Returns nil if no
  336.                such menu item is found or if the menu item is disabled.
  337.                Note that Ch is case-insensitive.
  338.           Function GetHelpCtx:Word; virtual;            Override: Sometimes
  339.                This method returns the help context of the current menu
  340.                selection.  If this is hcNoContext, the parent menu's
  341.                current context is checked.  If there is no parent menu,
  342.                GetHelpCtx returns hcNoContext.
  343.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  344.                                                            Override: Always
  345.  
  346.  
  347.  
  348.  
  349.                                      - 6 -
  350.                This method returns the rectangle occupied by the given menu
  351.                item in R.  Descendants of TMenuView must override this
  352.                method in order to produce the correct rectangle in R.
  353.           Procedure HandleEvent(var Event:TEvent); virtual;
  354.                                                             Override: Often
  355.                Handle keyboard, mouse, and broadcast events for the menu.
  356.                Keyboard events are handled by position the highlighted bar
  357.                on the menu item with that highlighted character, then the
  358.                item is activated.
  359.                Mouse events are handled by tracking the mouse cursor while
  360.                the left mouse button is pressed by the MouseEvent function.
  361.                Broadcast events with the cmCommandSetChanged command causes
  362.                the menu to redraw itself.
  363.                Any object that overrides HandleEvent MUST chain back to
  364.                this method.
  365.           Function HotKey(aKeyCode:Word):PMenuItem; virtual;
  366.                                                            Override: Seldom
  367.                This method checks the current menu for the hotkey, no such
  368.                item is found, it checks the ParentMenu.
  369.           Function ItemAt(P:TPoint):PMenuItem; virtual;    Override: Always
  370.                This method returns the item located at point P, or nil if
  371.                no item exists there.  Descendants of TMenuView must
  372.                override ItemAt in order to produce the correct result.
  373.           Function Menu:PMenu; virtual;                    Override: Always
  374.                This is an abstract method that must be overriden.
  375.           Function MouseInMenus(Where:TPoint):Boolean;
  376.                Returns if the point in Where is located somewhere in the
  377.                currently displayed menu chain.
  378.  
  379.  
  380.      TMenuView - Descended from TMenuMetaView
  381.           TMenuBar and TMenuBox are descended from this object.  It is not
  382.           intended to be instantiated.
  383.  
  384.           FIELDS
  385.           ------
  386.           TrapKeys : Byte                                        READ/WRITE
  387.                TrapKeys contains the keyboard shift mask that the menu
  388.                should respond to.  By default, only TMenuBar uses this and
  389.                sets it to kbAltShift.
  390.  
  391.           METHODS
  392.           -------
  393.           Constructor Init(var Bounds:TRect; aMenu:PMenu;
  394.                            aParentMenu:PMenuMetaView);
  395.                Calls TMenuMetaView to initialize the bounds parameter, then
  396.                initializes Menu and ParentMenu to their respective
  397.                parameters.  TrapKeys is set to zero.
  398.           Constructor Load(var S:TStream);
  399.                Creates a TMenuView object and initializes it to the
  400.                information read from the stream.
  401.           Destructor Done; virtual;                        Override: Seldom
  402.                Calls TMenuMetaView.Done and disposes of Menu if ParentMenu
  403.                is nil.
  404.  
  405.  
  406.  
  407.                                      - 7 -
  408.           Function GetPalette:PPalette; virtual;        Override: Sometimes
  409.                Returns a pointer to the defualt CMenuView palette.
  410.           Procedure HandleEvent(var Event:TEvent); virtual;
  411.                                                             Override: Often
  412.                Handles keyboard and command events.  Keyboard events with
  413.                the shift state included in the TrapKeys mask cause the menu
  414.                to focus on that menu item.
  415.                Command events with the command cmMenu toggle the menu
  416.                between a modal and non-modal state.
  417.                Any object that overrides HandleEvent MUST chain back to
  418.                this method.
  419.           Function Menu:PMenu; virtual;                 Override: Sometimes
  420.                Returns the list structure of the menu that the view is
  421.                currently using.
  422.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  423.                Stores the object onto the stream.
  424.  
  425.      TMenuBar - Descended from TMenuView
  426.           TMenuBar draws itself as a list of horizontal menu items.
  427.  
  428.           METHODS
  429.           -------
  430.           Constructor Init(var Bounds:TRect; aMenu:PMenu);
  431.                Calls TMenuView.Init with Bounds and aMenu and nil as the
  432.                ParentMenu.  GrowMode is set to gfGrowHiX and Options is set
  433.                to include ofPull and ofPreProcess.  TrapKeys defaults to
  434.                kbAltShift to respond to alternate quick-keys.
  435.           Procedure Draw; virtual;                         Override: Seldom
  436.                Uses the palette to draw the menu bar horizontally across
  437.                the screen.  The focused menu item is highlighted again
  438.                using the default palette.
  439.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  440.                                                            Override: Seldom
  441.                Returns the rectangle containing Item.
  442.           Procedure HandleEvent(var Event:TEvent); virtual;
  443.                                                            Override: Seldom
  444.                If the menubar is in a modal state, it will respond to right
  445.                arrow, left arrow, end, and home keys.   A down key will
  446.                cause the current menu item to be 'pulled' down if not
  447.                already pulled.
  448.                Any object that overrides HandleEvent MUST chain back to
  449.                this method.
  450.  
  451.      TMenuBox - Descended from TMenuView
  452.           TMenuBox is a rectangle that is automatically sized to include
  453.           its menu items.  It can be used as submenus for a menu bar, as a
  454.           standalone menu, or as a pop-up menu.
  455.  
  456.           METHODS
  457.           -------
  458.           Constructor Init(var Bounds:TRect; aMenu:PMenu;
  459.                            aParentMenu:PMenuMetaView);
  460.                Calls TMenuView.Init with the Bounds, aMenu, aParentMenu.
  461.                The State is set to include a shadow and options is set to
  462.  
  463.  
  464.  
  465.                                      - 8 -
  466.                include ofPreProcess.  Bounds is altered to adjust for the
  467.                width and length of the menu.
  468.           Procedure Draw; virtual;                         Override: Seldom
  469.                Draws a box containing the menu items using the default
  470.                palette.  The focused menu item is highlighted.
  471.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  472.                                                            Override: Seldom
  473.                Returns the rectangle containing Item in R.
  474.           Procedure HandleEvent(var Event:TEvent); virtual;
  475.                                                            Override: Seldom
  476.                HandleEvent responds to the down arrow, up arrow, page-down,
  477.                and page-up keys as expected.
  478.                Any object which overrides HandleEvent MUST chain back to
  479.                this method.
  480.  
  481.      TStatusLine - Descended from TMenuMetaView
  482.           The status line is essentially a linked list of menus, one of
  483.           which is displayed depending on the current help context.  As a
  484.           menu itself, the status line can contain TMenuCommands and
  485.           TMenuSubMenus.   Also, because TMenuMetaView is TStatusLine's
  486.           ancestor, TStatusLine can become focused and modal just like any
  487.           other menu.
  488.  
  489.           FIELDS
  490.           ------
  491.           Defs : PStatusDef                                       READ ONLY
  492.                Defs is the start of the linked list of menus.  Defs is
  493.                normally initialized through a series of calls to
  494.                NewStatusDef.
  495.           CurrentDef : PStatusDef                                 READ ONLY
  496.                Returns the status definition current being displayed
  497.                according to the current help context.
  498.  
  499.           METHODS
  500.           -------
  501.           Constructor Init(var Bounds:TRect; aDefs:PStatusDef);
  502.                Calls TMenuMetaView.Init with the Bounds parameter.  Options
  503.                is set to include ofPreProcess and GrowMode is set to
  504.                gfGrowLoY+gfGrowHiX+gfGrowHiY.  Defs is set to aDefs and
  505.                CurrentDef is also set to Defs.
  506.           Constructor Load(var S:TStream);
  507.                Reads the status line and all associated status line
  508.                definitions from the stream.
  509.           Destructor Done; virtual;                        Override: Seldom
  510.                Calls TMenuMetaView.Done and then disposes of all of the
  511.                status line definitions.
  512.           Procedure Activate(Item:PMenuItem); virtual;     Override: Seldom
  513.                The Item^.Execute called with a pointer to Self given as the
  514.                ParentMenu.  If cmCancel is returned and the ParentMenu is
  515.                nil, then the menu structure is aborted with cmCancel.  If
  516.                cmValid is returned, no operation is performed.  If any
  517.                command other than cmCancel or cmValid is returned, EndModal
  518.                is called with the result.  Differs from
  519.                TMenuMetaView.Activate in that a disabled item (an item with
  520.  
  521.  
  522.  
  523.                                      - 9 -
  524.                an associated command which has been disabled) won't remain
  525.                highlighted.
  526.           Procedure Draw; virtual;                         Override: Seldom
  527.                Draws the status line as a horizontal bar containing the
  528.                current definitions using the status line palette.  The
  529.                focused item is highlighted, also using the palette.
  530.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  531.                                                            Override: Seldom
  532.                Returns the rectangle occupied by Item in R.
  533.           Function GetPalette:PPalette; virtual;        Override: Sometimes
  534.                Returns the default CStatusLine palette.
  535.           Procedure Hint(aHelpCtx:Word):String; virtual;    Override: Often
  536.                Returns a hint string for the current help context.  This
  537.                string is displayed at the end of the status line after a
  538.                vertical divider bar.  The current Hint returns an empty
  539.                string and must be overriden to provide any useful
  540.                information.
  541.           Function Menu:PMenu; virtual;                    Override: Seldom
  542.                Returns the current status definition contained in
  543.                CurrentDef.
  544.           Procedure Store(var S:TStream);
  545.                Writes the status line and all of its status line
  546.                definitions to the stream.
  547.           Procedure Update; virtual;                       Override: Seldom
  548.                Updates the status line to display the definition for the
  549.                current help context.  Normally never called except by the
  550.                TApp.Idle method.
  551.  
  552.      OBJECT HIERARCHY
  553.      ----------------
  554.      Linked list objects and storage objects:
  555.      TObject____TMenuItem_____TMenuCommand
  556.           \         \
  557.            \         \________TMenuSubMenu
  558.             \
  559.              \___TMenu________TStatusDef
  560.  
  561.      Menu view objects:
  562.      TView______TMenuMetaView_TMenuView
  563.                     \              \
  564.                      \              \______TMenuBar
  565.                       \              \
  566.                        \              \____TMenuBox
  567.                         \
  568.                          \____TStatusLine
  569.  
  570.      OTHER TYPES
  571.      -----------
  572.           TMenuStr       =    String[31]
  573.           PMenu          =    ^TMenu
  574.           PMenuMetaView  =    ^TMenuMetaView
  575.           PMenuItem      =    ^TMenuItem
  576.           PMenuCommand   =    ^TMenuCommand
  577.           PMenuSubMenu   =    ^TMenuSubMenu
  578.  
  579.  
  580.  
  581.                                      - 10 -
  582.           PStatusDef     =    ^TStatusDef
  583.           PMenuView      =    ^TMenuView
  584.           PMenuBar       =    ^TMenuBar
  585.           PMenuBox       =    ^TMenuBox
  586.           PStatusLine    =    ^TStatusLine
  587.  
  588.  
  589.      OTHER ROUTINES
  590.      --------------
  591.      Procedure DisposeMenu(Menu:PMenu)
  592.           Reclaims the memory used by Menu's items and any submenus that
  593.           exist in Menu.
  594.      Function NewItem(Name, Param:TMenuStr; KeyCode:Word; Command:Word;
  595.                       aHelpCtx:Word; Next:PMenuItem):PMenuItem
  596.           Creates and returns a pointer to a new PMenuCommand object
  597.           initialized with the proper parameters.
  598.      Function NewLine(Next:PmenuItem):PMenuItem
  599.           Creates and returns a pointer to a new PMenuItem object.  The
  600.           PMenuItem object has its Name and Param fields initialized to an
  601.           empty string and HelpCtx is set to hcNoContext.
  602.      Function NewMenu(Items:PMenuItem):PMenu
  603.           Creates and returns a pointer to a TMenu object which contains
  604.           Items.  Items is normally created by nesting calls to NewItem,
  605.           NewSubMenu, and NewLine.
  606.      Function NewStatusDef(aMin, aMax:Word; aItems:PMenuItem;
  607.                            aNext:PStatusDef):PStatusDef
  608.           Creates and returns a pointer to a new TStatusDef object
  609.           initialized with the proper parameters.  Normally, aItems is a
  610.           set of nested calls to NewStatusKey, NewItem, or NewSubMenu.
  611.      Function NewStatusKey(aText:String; aKeyCode:Word; aCommand:Word;
  612.                            aNext:PMenuItem):PMenuItem
  613.           Creates and returns a pointer to a new TStatusKey object
  614.           initialized with the proper parameters.
  615.      Function NewStatusMenu(aText:String; aHelpCtx, aKeyCode:Word;
  616.                             SubMenu:PMenu; aNext:PMenuItem):PMenuItem
  617.           Creates a submenu specifically for the status line.  Notice that
  618.           a status line submenu also takes on a KeyCode value so that it
  619.           can be activated from the keyboard.
  620.      Function NewSubMenu(Name:TMenuStr; aHelpCtx:Word; SubMenu:PMenu;
  621.                          Next:PMenuItem)
  622.           Creates and returns a pointer to a new TMenuSubMenu object
  623.           initialized to the proper parameters.
  624.  
  625.      CONSTANTS
  626.      ---------
  627.           CMenuView      =    #2#3#4#5#6#7
  628.           CStatusLine    =    #2#4#4#5#6#7
  629.           ofPull         =    $0400
  630.                When the ofPull bit is set in a menu's Options field, the
  631.                menu's items will automatically pull their submenus when
  632.                selected.  An example of such a menu would be the menu bar.
  633.           sfPulled       =    $1000
  634.  
  635.  
  636.  
  637.  
  638.  
  639.                                      - 11 -
  640.                If this state bit is set, the one of the items in the menu
  641.                currently has its submenu pulled.  Note that the setting of
  642.                this bit is not necessarily related to the ofPull bit.
  643.           sfUpdate       =    $2000
  644.                Used only on the TStatusLine object when the status line
  645.                needs to be updated.
  646.  
  647.      SUPPORT
  648.      -------
  649.      Registered users can receive free support for EnhMenus via CompuServe
  650.      account number 71441,2402.  Any questions or comments should also be
  651.      directed through CompuServe at the same account number.
  652.  
  653.      Thanks for using EnhMenus!
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.                                      - 12 -
  698.